Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added admin user to migrations and read me, reformatted to PSR-1/PSR-2 #3

Open
wants to merge 3 commits into
base: rewrite
Choose a base branch
from

Conversation

stosh15x
Copy link

@stosh15x stosh15x commented Nov 23, 2016

I updated the migrations to add a default admin user to the cakeadmin_administrators table. I also updated the readme file to reflect the login credentials.

Edit by @bobmulder:

List of to do's for this PR:

Implementations
  • Add login screen
  • Add more default menu items to left menu
Bugfixes
  • Fix default templates/views (like dashboard and post type views)
  • Remove duplicated menu in content view (I saw it on dashboard)

Copy link

@bobmulder bobmulder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stosh15x Thank you for your ideas. I've added some comments. Would like to hear from you :)

@@ -16,6 +16,9 @@ The recommended way to install composer packages is:

```
$ composer require bakkerij/cakeadmin:dev-rewrite
$ composer require friendsofcake/crud:^4.3
$ composer require gourmet/knp-menu:~0.4
$ composer require holt59/cakephp3-bootstrap-helpers:dev-master

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dependencies can be removed from documentation and added to our composer.json right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I had them in our dependencies they were not being updated with composer so I moved them into app and it worked. This would be another shell solution.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because you added the plugin to your plugins/Bakkerij/CakeAdmin for development reasons. Composer won't get that file.

When the package is loaded by an user, the package is located in the vendor folder, and Composer will recognize it, and load its dependencies.

TL;DR: This is only needed for development reasons but it might be solved another way...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I used composer to download your version into vendor. Deleted the cakeadmin directory from vendor/bakkerij and then cloned my fork into the directory. This was the only way I could work on the files without routing issues.

Either way you had the CRUD version in the dependencies of cakeadmin and composer did not pull it in.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stand corrected when I just started from scratch and the 2 were imported correctly when I used

composer require bakkerij/cakeadmin:dev-rewrite

use Migrations\AbstractMigration;

class Initial extends AbstractMigration {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a standard according to brackets {?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just used NetBeans auto format

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CakePHP has its own standard: http://book.cakephp.org/3.0/en/intro/conventions.html

You can validate your code using: https://github.com/cakephp/cakephp-codesniffer

It might be a good idea to follow those standards and conventions... Probably there is a plugin for Netbeans to auto format to CakePHP's conventions, else you should do it manually (http://blog.bobbyallen.me/2013/03/24/configuring-netbeans-for-psr-1-and-psr-2-coding-guidelines/).

'password' => 'test',
'active' => 1
]);
$AdminTable->save($user);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a seed would be cleaner, but personally I prefer a shell to create an user yourself...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree a shell would be the final solution but this can get us up and testing very quickly until the shell has been created

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So let's accept this as a quick dirty solution for now :P

@stosh15x stosh15x changed the title added admin user to migrations and read me added admin user to migrations and read me, reformatted to PSR-1/PSR-2 Nov 25, 2016
@bobmulder bobmulder self-assigned this Nov 25, 2016
@bobmulder
Copy link

Great work @stosh15x, I'll check it out asap!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants